from django.contrib import admin
from crm.models import *

# Register your models here.

class CompanydeptAdmin(admin.ModelAdmin):
    list_display = ['id', 'levelOneDept','levelTwoDept']

class EmployeeAdmin(admin.ModelAdmin):
    list_display = ['id', 'name','gender','birthday','phone','user','email','dept','jobtitle','is_valid']

class AccountAdmin(admin.ModelAdmin): 
    list_display = ['id', 'name','cust_no','type','industry', 'scale','country','province',
                  'city', 'post_code','address','finance_account','credit_quota','phone','email'  ,'website']

class ContactAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'gender','account','dept','title','phone','email','wechat','is_decisor','description']

class BizOppAdmin(admin.ModelAdmin):
    list_display =  ['id','name','account','contact','value','lead_source','probability','owner','owner_dept','closed_expect','description','stage','closed_at']

class DealAdmin(admin.ModelAdmin):
    list_display =  fields = ['order_number', 'contract', 'title', 'date','total_amount','account','opportunity','employee']

class CommunicationAdmin(admin.ModelAdmin):
    list_display = ['description','communicate_date','outcome','account','employee']

admin.site.register(Companydept, CompanydeptAdmin)
admin.site.register(Employee, EmployeeAdmin)
admin.site.register(Account, AccountAdmin)
admin.site.register(Contact, ContactAdmin)
admin.site.register(BizOpp, BizOppAdmin)
admin.site.register(Deal, DealAdmin)
admin.site.register(Communication, CommunicationAdmin)